<html>
<head>
<title>SJSPyFL demo</title>
</head>
<body>



<textarea width="100%" height="400px" style="width:100%;height:400px" id="code" wrap="logical" rows="21" cols="42">
print "This will be printed"
</textarea>

<input id="interpret" type="submit" value="Interpret"></input>

<textarea width="100%" height="400px" style="width:100%;height:400px" id="output" wrap="logical" rows="21" cols="42">
</textarea>

<script type="text/javascript">
function interpret() {
  output_area = document.getElementById("output");
  code_area = document.getElementById("code");
  code = code_area.value;
  var printed_string = code.match(/(?:print\s+)"(.*)"/)[1];  
  if ( printed_string != null ) {
	output_area.innerHTML = printed_string;
  }
  else {
	output_area.innerHTML = ("Error: Unknown python statement");
  }
}
var interpret_button = document.getElementById("interpret");
interpret_button.onclick = interpret
</script>

</body>
</html>